<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="google-site-verification" content="TZE0rZyIqLl10trYu3BWBWa1Vmz6HFwhb2OcNEK4u-s" />
     <link rel="shortcut icon" href= /img/favicon.ico >
    <title>
        Hexo
    </title>
    <meta name="description" content= 嘿。欢迎访问！ >
    <meta name="keywords" content=  >
    
<link rel="stylesheet" href="/libs/highlight/styles/monokai-sublime.css">

    
<link rel="stylesheet" href="/libs/font-awesome/css/font-awesome.min.css">

    
<link rel="stylesheet" href="/css/style.css">

<meta name="generator" content="Hexo 6.0.0"></head>
<body id="bodyx">
    <div class="hd posts">
    <a href="/index.html"><i class="fa fa-home
 replay-btn" aria-hidden="true"></i></a>
    <div class="post-title">
        <p>
            第一课
        </p>
        <hr>
    </div>
    <div class="post-content">
        <h3 id="1-自增变量"><a href="#1-自增变量" class="headerlink" title="1 自增变量"></a>1 自增变量</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">int</span> i = <span class="number">1</span>;</span><br><span class="line">    i = i++;</span><br><span class="line">    <span class="keyword">int</span> j = i++;</span><br><span class="line">    <span class="keyword">int</span> k = i + ++i * i++;</span><br><span class="line">    System.out.println(<span class="string">&quot;i=&quot;</span> + i + <span class="string">&quot;,j=&quot;</span> + j + <span class="string">&quot;,k=&quot;</span> + k);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>代码运行结果</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">i=4,j=1,k=11</span><br><span class="line">分析(自增是直接在局部变量区加1，而运算要进行压栈和出栈操作。)：</span><br><span class="line">1. i = i++ 1进入操作栈，i进行++操作，此时i变为2，然后从操作栈取出1（1出栈）将1赋值给i。</span><br><span class="line">2. j = i++ 1进入操作栈，i进行++操作，此时i变为2，然后从操作栈取出1（1出栈）将1赋值给j（i=2，j=1）。</span><br><span class="line">3. k = i + ++i * i++ 将2入栈。++i，i值加1变为3，3入栈。i++，此时i=3，将3入栈，i值加1，变为4。对栈中元素先进行乘操作，然后加操作。11赋值给k，k=11。</span><br><span class="line"></span><br><span class="line">0: iconst_1                 //将常量1压入操作数栈　</span><br><span class="line">1: istore_1                 //将操作数栈顶元素（1）弹出，存入局部变量位置1处（i=1）</span><br><span class="line">2: iload_1                  //加载局部变量第一个变量压入操作栈中</span><br><span class="line">3: iinc          1, 1       //局部变量表1位置的值自增1（i=2）</span><br><span class="line">6: istore_1                 //将操作数栈顶的值（1）出栈存入局部变量表1的位置处（i=1）</span><br><span class="line">7: iload_1                  //加载局部变量第一个变量压入操作栈中</span><br><span class="line">8: iinc          1, 1       //局部变量表1位置的值自增1（i=2）</span><br><span class="line">11: istore_2                //将操作数栈顶的值（1）出栈存入局部变量表2的位置处（j=1）</span><br><span class="line">12: iload_1                 //加载局部变量第一个变量(1)压入操作栈中</span><br><span class="line">13: iinc          1, 1      //局部变量表1位置的值自增1(i=3)</span><br><span class="line">16: iload_1                 //加载局部变量第一个变量(3)压入操作栈中</span><br><span class="line">17: iload_1                 //加载局部变量第一个变量(3)压入操作栈中</span><br><span class="line">18: iinc          1, 1      //局部变量表1位置的值自增1(i=4)，此时栈中元素为2，3，3</span><br><span class="line">21: imul                    //将栈顶两个元素(3,3)进行乘操作结果压入操作栈。 栈中元素2，9</span><br><span class="line">22: iadd                    //将栈顶两个元素(2,9)进行加操作结果压入操作栈。栈中元素11</span><br><span class="line">23: istore_3                //将操作数栈顶的值（11）出栈存入局部变量表3的位置处（k=11）</span><br></pre></td></tr></table></figure>
<h3 id="2-单列模式"><a href="#2-单列模式" class="headerlink" title="2 单列模式"></a>2 单列模式</h3><ul>
<li>某个类只能有一个实例（构造器私有化）</li>
<li>必须自己创建这个实例（含有一个该类的静态变量保存这个唯一实例）</li>
<li>必须向整个系统提供这个实例（对外提供该实例对象的方式）</li>
</ul>
<h4 id="2-1-饿汉模式单例（直接创建对象，线程安全）"><a href="#2-1-饿汉模式单例（直接创建对象，线程安全）" class="headerlink" title="2.1 饿汉模式单例（直接创建对象，线程安全）"></a>2.1 饿汉模式单例（直接创建对象，线程安全）</h4><p>基于JVM的类加载器机制避免了多线程的同步问题，对象在类装载时就实例化</p>
<ul>
<li>直接实例化式<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">public class Singleton &#123;</span><br><span class="line">    private static final Singleton INSTANCE = new Singleton();</span><br><span class="line"></span><br><span class="line">    private Singleton() &#123;</span><br><span class="line">        </span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li>
<li>枚举式（枚举本身构造方法私有化）<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">public enum Singleton &#123;</span><br><span class="line">    INSTANCE</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li>
<li>静态代码块式<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">public class Singleton &#123;</span><br><span class="line">    private static final Singleton INSTANCE;</span><br><span class="line"></span><br><span class="line">    static &#123;</span><br><span class="line">        INSTANCE = new Singleton();</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    private Singleton() &#123;</span><br><span class="line"></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">可以用来读取配置文件</span><br><span class="line">public class Singleton &#123;</span><br><span class="line">    private static final Singleton INSTANCE;</span><br><span class="line">    private String name;</span><br><span class="line"></span><br><span class="line">    static &#123;</span><br><span class="line">        try &#123;</span><br><span class="line">            Properties prop = new Properties();</span><br><span class="line">            prop.load(Singleton.class.getClassLoader().getResourceAsStream(&quot;&quot;));</span><br><span class="line">            INSTANCE = new Singleton(prop.getProperty(&quot;key&quot;));</span><br><span class="line">        &#125; catch (IOException e) &#123;</span><br><span class="line">            throw new RuntimeException(e);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    private Singleton(String name) &#123;</span><br><span class="line">        this.name = name;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li>
</ul>
<h4 id="2-2-懒汉模式单例（延时创建对象，线程不安全）"><a href="#2-2-懒汉模式单例（延时创建对象，线程不安全）" class="headerlink" title="2.2 懒汉模式单例（延时创建对象，线程不安全）"></a>2.2 懒汉模式单例（延时创建对象，线程不安全）</h4><ul>
<li><p>线程不安全</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">public class Singleton &#123;</span><br><span class="line">    private Singleton instance = null;</span><br><span class="line"></span><br><span class="line">    private Singleton() &#123;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public Singleton getInstance() &#123;</span><br><span class="line">        if (instance == null)&#123;</span><br><span class="line">            instance = new Singleton();</span><br><span class="line">        &#125;</span><br><span class="line">        return instance;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">线程不安全。</span><br><span class="line">两个线程同时获取instance。当线程1进行判断，判断此时instance为空，开始创建实例对象。此时线程2进行判断，判断时线程1还未创建实例对象，线程2进入判断体中，开始创建实例对象。最后线程1和线程2都创建了实例对象。</span><br></pre></td></tr></table></figure></li>
<li><p>线程安全</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br></pre></td><td class="code"><pre><span class="line">public class Singleton &#123;</span><br><span class="line">    private static Singleton instance = null;</span><br><span class="line"></span><br><span class="line">    private Singleton() &#123;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public synchronized static Singleton getInstance() &#123;</span><br><span class="line">        if (instance == null) &#123;</span><br><span class="line">            instance = new Singleton();</span><br><span class="line">        &#125;</span><br><span class="line">        return instance;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">public class Singleton &#123;</span><br><span class="line">    private static Singleton instance = null;</span><br><span class="line"></span><br><span class="line">    private Singleton() &#123;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public static Singleton getInstance() &#123;</span><br><span class="line">        synchronized (Singleton.class) &#123;</span><br><span class="line">            if (instance == null) &#123;</span><br><span class="line">                instance = new Singleton();</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        return instance;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">以上两种方式为线程安全的饿汉式单例，但是效率低，每次获取都要同步等待。为了提高效率，加入DCL，DCL即Double Check Lock，双重检查锁定。</span><br><span class="line"></span><br><span class="line">public class Singleton &#123;</span><br><span class="line">    private static Singleton instance = null;</span><br><span class="line"></span><br><span class="line">    private Singleton() &#123;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public synchronized static Singleton getInstance() &#123;</span><br><span class="line">        if (instance == null) &#123;</span><br><span class="line">            synchronized (Singleton.class) &#123;</span><br><span class="line">                if (instance == null) &#123;</span><br><span class="line">                    instance = new Singleton();</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        return instance;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">大致为线程安全，但会出现DCL问题。主要在instance = new Singleton();创建对象时会出现指令乱序现象。</span><br><span class="line">一般情况下创建对象的过程为：</span><br><span class="line">1.为对象分配内存空间</span><br><span class="line">2.初始化对象</span><br><span class="line">3.将内存空间的地址赋值给对应的引用</span><br><span class="line">但是由于jvm优化问题，会产生重排序现象。由原来的1-&gt;2-&gt;3变为1-&gt;3-&gt;2。</span><br><span class="line">线程1获取对象，判断对象为空，获取同步锁，开始创建对象，为对象分配内存空间，或者初始化对象，但是未将内存空间地址给对象引用。此时线程2获取对象，判断为空，锁机构，等待锁释放后，线程2进入，创建了新对象。</span><br><span class="line"></span><br><span class="line">public class Singleton &#123;</span><br><span class="line">    // 通过volatile关键字来确保安全，保证指令不重排</span><br><span class="line">    private volatile static Singleton instance = null;</span><br><span class="line"></span><br><span class="line">    private Singleton() &#123;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public synchronized static Singleton getInstance() &#123;</span><br><span class="line">        if (instance == null) &#123;</span><br><span class="line">            synchronized (Singleton.class) &#123;</span><br><span class="line">                if (instance == null) &#123;</span><br><span class="line">                    instance = new Singleton();</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        return instance;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li>
<li><p>静态内部类形式</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Singleton</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">private</span> <span class="keyword">static</span> <span class="class"><span class="keyword">class</span> <span class="title">Inner</span> </span>&#123;</span><br><span class="line">        <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> Singleton INSTANCE = <span class="keyword">new</span> Singleton();</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="keyword">static</span> Singleton <span class="title">getInstance</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="keyword">return</span> Inner.INSTANCE;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="3-类初始化和实例初始化"><a href="#3-类初始化和实例初始化" class="headerlink" title="3 类初始化和实例初始化"></a>3 类初始化和实例初始化</h3><p>一个Java文件从编码完成到最终执行，一般主要包括两个过程</p>
</li>
<li><p>编译，即把我们写好的java文件，通过javac命令编译成字节码，也就是我们常说的.class文件。</p>
</li>
<li><p>运行，则是把编译生成的.class文件交给Java虚拟机(JVM)执行。</p>
</li>
</ul>
<p>JVM不是一开始就把所有的类都加载进内存中，而是只有第一次遇到某个需要运行的类时才会加载，且<strong>只加载一次</strong>（懒加载）。</p>
<h4 id="3-1-类的生命周期"><a href="#3-1-类的生命周期" class="headerlink" title="3.1 类的生命周期"></a>3.1 类的生命周期</h4><p>类加载过程即是指JVM虚拟机把.class文件中类信息加载进内存，并进行解析生成对应的class对象的过程。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">graph LR</span><br><span class="line">加载--&gt;链接</span><br><span class="line">链接--&gt;初始化</span><br><span class="line">初始化--&gt;使用</span><br><span class="line">使用--&gt;卸载</span><br></pre></td></tr></table></figure>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">gantt</span><br><span class="line">dateFormat DD</span><br><span class="line">section 加载</span><br><span class="line">加载（loading）: 01, 2d</span><br><span class="line">section 链接</span><br><span class="line">验证（Verification）: 03, 2d</span><br><span class="line">section 链接</span><br><span class="line">准备（Preparation）: 03, 2d</span><br><span class="line">section 链接</span><br><span class="line">解析（Resolution）: 03, 2d</span><br><span class="line">section 初始化</span><br><span class="line">初始化（init）: 05, 2d</span><br><span class="line">section 使用</span><br><span class="line">使用（Using）: 07, 2d</span><br><span class="line">section 卸载</span><br><span class="line">卸载（Unloading）: 09, 2d</span><br></pre></td></tr></table></figure>
<h5 id="3-1-1-加载（loading）"><a href="#3-1-1-加载（loading）" class="headerlink" title="3.1.1 加载（loading）"></a>3.1.1 加载（loading）</h5><p>指的是把class字节码文件从各个来源通过类加载器装载入内存中。</p>
<ul>
<li>字节码来源。一般的加载来源包括从本地路径下编译生成的.class文件，从jar包中的.class文件，从远程网络，以及动态代理实时编译</li>
<li>类加载器。一般包括<strong>启动类加载器</strong>，<strong>扩展类加载器</strong>，<strong>应用类加载器</strong>，以及用户的<strong>自定义类加载器</strong>。</li>
</ul>
<h5 id="3-1-2-连接（linking）"><a href="#3-1-2-连接（linking）" class="headerlink" title="3.1.2 连接（linking）"></a>3.1.2 连接（linking）</h5><h6 id="3-1-2-1-验证（Verification）"><a href="#3-1-2-1-验证（Verification）" class="headerlink" title="3.1.2.1 验证（Verification）"></a>3.1.2.1 验证（Verification）</h6><p>主要是为了保证加载进来的字节流符合虚拟机规范，不会造成安全错误。</p>
<p>包括对于<strong>文件格式的验证</strong>，比如常量中是否有不被支持的常量？文件中是否有不规范的或者附加的其他信息？</p>
<p>对于<strong>元数据的验证</strong>，比如该类是否继承了被final修饰的类？类中的字段，方法是否与父类冲突？是否出现了不合理的重载？</p>
<p>对于<strong>字节码的验证</strong>，保证程序语义的合理性，比如要保证类型转换的合理性。</p>
<p>对于<strong>符号引用的验证</strong>，比如校验符号引用中通过全限定名是否能够找到对应的类？校验符号引用中的访问性（private，public等）是否可被当前类访问？</p>
<p>主要就是为了验证.class文件是否符合规范</p>
<h6 id="3-1-2-2-准备（Preparation）"><a href="#3-1-2-2-准备（Preparation）" class="headerlink" title="3.1.2.2 准备（Preparation）"></a>3.1.2.2 准备（Preparation）</h6><p>主要是为<strong>类变量</strong>（注意，不是实例变量）分配内存，并且赋予默认值（不是初始值）。例如：java代码中，private static int j = 9；在此阶段中为j赋值默认值0而不是初始值9。</p>
<h6 id="3-1-2-3-解析（Resolution）"><a href="#3-1-2-3-解析（Resolution）" class="headerlink" title="3.1.2.3 解析（Resolution）"></a>3.1.2.3 解析（Resolution）</h6><p>将常量池中的符号引用替换为直接引用（内存地址）的过程</p>
<h5 id="3-1-3-初始化（initialization）"><a href="#3-1-3-初始化（initialization）" class="headerlink" title="3.1.3 初始化（initialization）"></a>3.1.3 初始化（initialization）</h5><p>为类的静态变量赋初值</p>
<h5 id="3-1-4-使用（Using）"><a href="#3-1-4-使用（Using）" class="headerlink" title="3.1.4 使用（Using）"></a>3.1.4 使用（Using）</h5><p>暂无</p>
<h5 id="3-1-5-卸载（Unloading）"><a href="#3-1-5-卸载（Unloading）" class="headerlink" title="3.1.5 卸载（Unloading）"></a>3.1.5 卸载（Unloading）</h5><p>暂无</p>
<h4 id="3-2-实例对象初始化"><a href="#3-2-实例对象初始化" class="headerlink" title="3.2 实例对象初始化"></a>3.2 实例对象初始化</h4><p>当一个对象被创建时，虚拟机就会为其<strong>分配内存来存放对象自己的实例变量</strong>及其从*<strong>父类继承过来的实例变量(即使这些从超类继承过来的实例变量有可能被隐藏也会被分配空间)<strong>。在为这些实例变量分配内存的同时，这些实例变量也会被赋予默认值(零值)。在内存分配完成之后，Java虚拟机就会开始对新创建的对象按照程序猿的意志进行初始化。在Java对象初始化过程中，主要涉及三种执行对象初始化的结构，分别是 <strong>实例变量初始化</strong>、</strong>实例代码块初始化</strong> 以及 <strong>构造函数初始化</strong>。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">graph LR</span><br><span class="line">父类静态代码块或静态属性--&gt;子类静态代码块或静态属性</span><br><span class="line">子类静态代码块或静态属性--&gt;父类普通代码块</span><br><span class="line">父类普通代码块--&gt;父类构造方法</span><br><span class="line">父类构造方法--&gt;子类普通代码块</span><br><span class="line">子类普通代码块--&gt;子类构造方法</span><br></pre></td></tr></table></figure>
<p>顺序 父类static{}&gt;子类static{} &gt; 父类{} &gt; 子类{} &gt; 父类构造方法 &gt; 子类构造方法。</p>
<p>普通代码块在经过javac编译为.class文件后，会将普通代码块的内容放在构造方法内部。并在构造方法内最前部分。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">源代码</span><br><span class="line">public class Animal &#123;</span><br><span class="line">    public Animal()&#123;</span><br><span class="line">        System.out.println(&quot;动物&quot;);</span><br><span class="line">    &#125;</span><br><span class="line">    &#123;</span><br><span class="line">        System.out.println(&quot;熊猫&quot;);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">.class文件</span><br><span class="line">public class Animal &#123;</span><br><span class="line">    public Animal() &#123;</span><br><span class="line">        System.out.println(&quot;熊猫&quot;);</span><br><span class="line">        System.out.println(&quot;动物&quot;);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h4 id="3-3-案例"><a href="#3-3-案例" class="headerlink" title="3.3 案例"></a>3.3 案例</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br></pre></td><td class="code"><pre><span class="line">public class Father &#123;</span><br><span class="line">    private int i = test();</span><br><span class="line">    private static int j = method();</span><br><span class="line"></span><br><span class="line">    static &#123;</span><br><span class="line">        System.out.print(&quot;(1)&quot;);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public Father() &#123;</span><br><span class="line">        System.out.print(&quot;(2)&quot;);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    &#123;</span><br><span class="line">        System.out.print(&quot;(3)&quot;);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public int test() &#123;</span><br><span class="line">        System.out.print(&quot;(4)&quot;);</span><br><span class="line">        return 1;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public static int method() &#123;</span><br><span class="line">        System.out.print(&quot;(5)&quot;);</span><br><span class="line">        return 2;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public static void main(String[] args) &#123;</span><br><span class="line">        Father f = new Father();</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">public class Som extends Father &#123;</span><br><span class="line">    private int i = test();</span><br><span class="line">    private static int j = method();</span><br><span class="line"></span><br><span class="line">    static &#123;</span><br><span class="line">        System.out.print(&quot;(6)&quot;);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public Som() &#123;</span><br><span class="line">        System.out.print(&quot;(7)&quot;);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    &#123;</span><br><span class="line">        System.out.print(&quot;(8)&quot;);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public int test() &#123;</span><br><span class="line">        System.out.print(&quot;(9)&quot;);</span><br><span class="line">        return 1;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public static int method() &#123;</span><br><span class="line">        System.out.print(&quot;(10)&quot;);</span><br><span class="line">        return 2;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public static void main(String[] args) &#123;</span><br><span class="line">        Som s1 = new Som();</span><br><span class="line">        System.out.println();</span><br><span class="line">        Som s2 = new Som();</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">结果：</span><br><span class="line">(5)(1)(10)(6)(9)(3)(2)(9)(8)(7)</span><br><span class="line">(9)(3)(2)(9)(8)(7)</span><br></pre></td></tr></table></figure>
<p>结果分析</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">Som s1 = new Som();经历以下2个阶段</span><br><span class="line">1. 类加载，先加载父类在加载子类（只加载一次）</span><br><span class="line">类加载阶段，对类中的静态代码块和静态属性初始化（从上往下走）</span><br><span class="line">代码中：静态属性j在静态代码块之前，所以先初始化j在初始化静态代码块，然后就是先加载父类在加载子类。对应结果(5)(1)(10)(6)</span><br><span class="line">2. 实例初始化，依然是先初始化父类在初始化子类。依次初始化父类实例属性，初始化父类普通代码块，初始化父类构造方法，初始化子类属性，初始化子类普通代码块，初始化子类构造方法。其中因子类重写了test()方法，所以在父类初始化父类属性i的时候，调用了子类重写的test()方法。父类实例初始化结果(9)(3)(2)，子类实例初始化结果(9)(8)(7)</span><br><span class="line">即Som s1 = new Som();最总结果为(5)(1)(10)(6)(9)(3)(2)(9)(8)(7)</span><br><span class="line">Som s2 = new Som();因类加载只执行一次，所以该语句只进行实例初始化，即结果为(9)(3)(2)(9)(8)(7)</span><br><span class="line">注：静态代码块和静态属性的执行顺序为至上而下，谁在前先执行谁。实例属性和普通代码块的执行顺序为至上而下，谁在前先执行谁。</span><br></pre></td></tr></table></figure>
<h3 id="4-方法的参数传递机制"><a href="#4-方法的参数传递机制" class="headerlink" title="4 方法的参数传递机制"></a>4 方法的参数传递机制</h3><ul>
<li>基本数据类型：传递数据值</li>
<li>引用数据类型：传递地址值。String和基本包装类型为不可变</li>
</ul>
<h3 id="5-Spring-Bean的作用域与区别"><a href="#5-Spring-Bean的作用域与区别" class="headerlink" title="5 Spring Bean的作用域与区别"></a>5 Spring Bean的作用域与区别</h3><p>默认情况下，spring只为每个在IOC容器里声明的bean创建<strong>唯一一个</strong>实例，整个IOC容器范围内共享该实例（单例模式）。</p>
<p>在Spring中，可以在<bean>元素的scope属性里设置bean的作用域。</p>
<table>
<thead>
<tr>
<th>模式（作用域）</th>
<th>中文</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td>singleton</td>
<td>单例模式（默认，多线程下不安全）</td>
<td>每一个Spring IoC容器都拥有唯一的一个实例对象。<br>IOC容器创建就会创建该bean的实例。</td>
</tr>
<tr>
<td>prototype</td>
<td>原型模式，每次使用时创建</td>
<td>每次通过 Spring 容器获取 prototype 定义的 bean 时，<br>容器都将创建一个新的 Bean 实例，<br>每个 Bean 实例都有自己的属性和状态。<br>而 singleton 全局只有一个对象。<br>根据经验，对有状态的bean使用prototype作用域<br>而对无状态的bean使用singleton作用域。<br>IOC容器创建时不回创建该bean的实例。</td>
</tr>
<tr>
<td>request</td>
<td>一次 request(请求) 一个实例</td>
<td>在一次 Http 请求中，容器会返回该 Bean 的同一实例。<br>而对不同的 Http 请求则会产生新的 Bean<br>而且该 bean 仅在当前 Http Request 内有效<br>当前 Http 请求结束，该 bean实例也将会被销毁。</td>
</tr>
<tr>
<td>session</td>
<td>会话</td>
<td>在一次 Http Session 中，容器会返回该 Bean 的同一实例。<br>而对不同的 Session 请求则会创建新的实例<br>该 bean 实例仅在当前 Session 内有效。<br>同 Http 请求相同，每一次session 请求创建新的实例<br>而不同的实例之间不共享属性<br>且实例仅在自己的 session 请求内有效<br>请求结束，则实例将被销毁。</td>
</tr>
<tr>
<td>global Session</td>
<td>全局会话，集群</td>
<td>在一个全局的 Http Session 中,容器会返回该 Bean 的同一个实例。<br>仅在使用 portlet context 时有效。</td>
</tr>
</tbody></table>
<h3 id="6-Spring支持的数据库事物传播属性和事务隔离级别"><a href="#6-Spring支持的数据库事物传播属性和事务隔离级别" class="headerlink" title="6 Spring支持的数据库事物传播属性和事务隔离级别"></a>6 Spring支持的数据库事物传播属性和事务隔离级别</h3><h4 id="6-1-脏写、脏读、不可重复读、幻读"><a href="#6-1-脏写、脏读、不可重复读、幻读" class="headerlink" title="6.1 脏写、脏读、不可重复读、幻读"></a>6.1 脏写、脏读、不可重复读、幻读</h4><ul>
<li>脏写：事务B去修改了事务 A 修改过的值，但是此时事务 A 还没提交，所以事务 A 随时会回滚，导致事务 B 修改的值也没了，这就是脏写的定义。</li>
<li>脏读：一个事务读取到了另一个事务未提交的数据。</li>
<li>不可重复读：一个事务内多次根据同一查询条件查询出来的同一行记录的值不一致。<br><br>在数据库中，A进程要多次查询同一个查询条件的数据；然后，A进程第一次查完，B进程就提交了一个记录的修改，A进程第二次查询，就发现记录变了。这就叫不可重复读。</li>
<li>幻读：一个事务用一样的 SQL 多次查询，结果每次查询都会发现查到一些之前没看到过的数据<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">脏写就是两个事务没提交的状况下，都修改同一条数据，结果一个事务回滚了，把另外一个事务修改的值也撤销了，所谓脏写就是两个事务没提交状态下修改同一个值。</span><br><span class="line">脏读就是一个事务修改了一条数据的值，结果还没提交呢，另外一个事务就读到了你修改的值，然后你回滚了，人家事务再次读，就读不到了，即人家事务读到了你修改之后还没提交的值，这就是脏读了。</span><br><span class="line">不可重复读，针对的是已经提交的事务修改的值，被你事务给读到了，你事务内多次查询，多次读到的是别的已经提交的事务修改过的值，这就导致不可重复读。</span><br><span class="line">幻读就是你一个事务用一样的 SQL 多次查询，结果每次查询都会发现查到一些之前没看到过的数据。注意，幻读特指的是你查询到了之前查询没看到过的数据。此时说明你是幻读了</span><br></pre></td></tr></table></figure>
<h4 id="6-2-事务隔离级别"><a href="#6-2-事务隔离级别" class="headerlink" title="6.2 事务隔离级别"></a>6.2 事务隔离级别</h4>事务的特性：</li>
<li>原子性（Atomicity）：事务开始后所有操作，要么全部做完，要么全部不做，不可能停滞在中间环节。事务执行过程中出错，会回滚到事务开始前的状态，所有的操作就像没有发生一样。也就是说事务是一个不可分割的整体，就像化学中学过的原子，是物质构成的基本单位。</li>
<li>一致性（Consistency）：事务开始前和结束后，数据库的完整性约束没有被破坏 。比如A向B转账，不可能A扣了钱，B却没收到。</li>
<li>隔离性（Isolation）：同一时间，只允许一个事务请求同一数据，不同的事务之间彼此没有任何干扰。比如A正在从一张银行卡中取钱，在A取钱的过程结束前，B不能向这张卡转账。</li>
<li>持久性（Durability）：事务完成后，事务对数据库的所有更新将被保存到数据库，不能回滚。<br><br>事务的隔离级别:</li>
<li>Read uncommitted(未授权读取、读未提交)：<br>如果一个事务已经开始写数据，则另外一个事务则不允许同时进行写操作，但允许其他事务读此行数据。该隔离级别可以通过“排他写锁”实现。这样就避免了更新丢失，却可能出现脏读。也就是说事务B读取到了事务A未提交的数据。</li>
<li>Read committed（授权读取、读提交）：<br>读取数据的事务允许其他事务继续访问该行数据，但是未提交的写事务将会禁止其他事务访问该行。该隔离级别避免了脏读，但是却可能出现不可重复读。事务A事先读取了数据，事务B紧接了更新了数据，并提交了事务，而事务A再次读取该数据时，数据已经发生了改变。</li>
<li>Repeatable read（可重复读取）：<br>可重复读是指在一个事务内，多次读同一数据。在这个事务还没有结束时，另外一个事务也访问该同一数据。那么，在第一个事务中的两次读数据之间，即使第二个事务对数据进行修改，第一个事务两次读到的的数据是一样的。这样就发生了在一个事务内两次读到的数据是一样的，因此称为是可重复读。读取数据的事务将会禁止写事务（但允许读事务），写事务则禁止任何其他事务。这样避免了不可重复读取和脏读，但是有时可能出现幻象读。（读取数据的事务）这可以通过“共享读锁”和“排他写锁”实现。</li>
<li>Serializable（序列化）：<br>提供严格的事务隔离。它要求事务序列化执行，事务只能一个接着一个地执行，但不能并发执行。如果仅仅通过“行级锁”是无法实现事务序列化的，必须通过其他机制保证新插入的数据不会被刚执行查询操作的事务访问到。序列化是最高的事务隔离级别，同时代价也花费最高，性能很低，一般很少使用，在该级别下，事务顺序执行，不仅可以避免脏读、不可重复读，还避免了幻像读。</li>
</ul>
<table>
<thead>
<tr>
<th>事务隔离级别</th>
<th>脏读</th>
<th>不可重复读</th>
<th>幻读</th>
</tr>
</thead>
<tbody><tr>
<td>读未提交(Read uncommitted)</td>
<td>X</td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td>读已提交(Read committed)</td>
<td>V</td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td>可重复读(Repeatable read)</td>
<td>V</td>
<td>V</td>
<td>X</td>
</tr>
<tr>
<td>串行化(Serializable)</td>
<td>V</td>
<td>V</td>
<td>V</td>
</tr>
</tbody></table>
<h4 id="6-3-Spring支持的事务传播机制"><a href="#6-3-Spring支持的事务传播机制" class="headerlink" title="6.3 Spring支持的事务传播机制"></a>6.3 Spring支持的事务传播机制</h4><ul>
<li>PROPAGATION_REQUIRED（默认）：支持当前事务，假设当前没有事务。就新建一个事务。<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ServiceB和 ServiceA在同一个事务里面，ServiceB如果异常，则整个事务认为是执行失败的，即便是在A里面try catch了异常也会导致A和B都回滚；同样，即便B执行成功，A执行报错产生异常，那么A和B都会回滚的；</span><br></pre></td></tr></table></figure></li>
<li>PROPAGATION_SUPPORTS：支持当前事务。假设当前没有事务，就以非事务的形式执行，本身以非事务形式执行;</li>
<li>PROPAGATION_MANDATORY：支持当前事务。假设当前没有事务，就抛出异常。也就是说他必须在一个父事务中去执行，否则就会抛出异常；</li>
<li>PROPAGATION_REQUIRES_NEW：新建事务。假设当前存在事务,把当前事务挂起;<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">比如服务A的事务级别是PROPAGATION_REQUIRED，那么服务B的级别是PROPAGATION_REQUIRES_NEW;那么当运行到ServiceB.methodB的时候,ServiceA.methodA所在的事务就会挂起。ServiceB.methodB会起一个新的事务,等待ServiceB.methodB的事务完毕以后，他才继续运行；跟PROPAGATION_REQUIRED的区别是会新起一个事务，而不是使用父事务，所以是两个截然不同的事务，ServiceB的执行报错，如果被ServiceA捕获了，不会影响到ServiceA的回滚</span><br></pre></td></tr></table></figure></li>
<li>PROPAGATION_NOT_SUPPORTED: 以非事务方式运行操作。假设当前存在事务，就把当前事务挂起。<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">比方ServiceA.methodA的事务级别是PROPAGATION_REQUIRED 。而ServiceB.methodB的事务级别是PROPAGATION_NOT_SUPPORTED ，那么当执行到ServiceB.methodB时。ServiceA.methodA的事务挂起。而他以非事务的状态执行完，再继续ServiceA.methodA的事务。</span><br></pre></td></tr></table></figure></li>
<li>PROPAGATION_NEVER：以非事务方式运行，假设当前存在事务，则抛出异常。<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">如果ServiceA.methodA的事务级别是PROPAGATION_REQUIRED。 而ServiceB.methodB的事务级别是PROPAGATION_NEVER ，那么ServiceB.methodB就要抛出异常了。 </span><br></pre></td></tr></table></figure></li>
<li>PROPAGATION_NESTED：如果当前存在事务，则在嵌套事务内执行。如果当前没有事务，则进行与PROPAGATION_REQUIRED类似的操作。<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">与PROPAGATION_REQUIRES_NEW的差别是，PROPAGATION_REQUIRES_NEW另起一个事务。将会与他的父事务相互独立。而Nested的事务和他的父事务是相依的，他的提交是要等和他的父事务一块提交的。也就是说，假设父事务最后回滚。他也要回滚的。</span><br></pre></td></tr></table></figure>
<h3 id="7-redis持久化"><a href="#7-redis持久化" class="headerlink" title="7 redis持久化"></a>7 redis持久化</h3><h3 id="8-数据库索引"><a href="#8-数据库索引" class="headerlink" title="8 数据库索引"></a>8 数据库索引</h3></li>
</ul>

    </div>

    
</div>
    <div class="footer" id="footer">
    <p>
    <!--<h4>版权所有 © 2020 | 作者: 暮雨秋风 | 主题 By <a class="theme-author" target="_blank" rel="noopener" href="https://github.com/Xunzhuo/hexo-theme-coder" style="font-size:14px; color: #969696">Coder</a></h4>-->
    <h4>Java苦修进行中......暮雨秋风</h4>
    
    相逢意气为君饮, 系马高楼垂柳边。
    <label class="el-switch el-switch-blue el-switch-sm" style="vertical-align: sub;">
        <input type="checkbox" name="switch" id="update_style">
        <span class="el-switch-style"></span>
    </label>

    <!--         <script type="text/javascript">
    var cnzz_protocol = (("https:" == document.location.protocol) ? "https://" : "http://");
    document.write(unescape("%3Cspan id='cnzz_stat_icon_1278548644'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "v1.cnzz.com/stat.php%3Fid%3D1278548644%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));
    </script> -->
</p>
</div>

<input type="hidden" id="web_style" value="black">
<input type="hidden" id="valine_appid" value="">
<input type="hidden" id="valine_appKey" value="">

<script src="/libs/jquery.min.js"></script>


<script src="/libs/highlight/highlight.pack.js"></script>

<script src='//cdn.jsdelivr.net/npm/valine@1.3.10/dist/Valine.min.js'></script>

<script src="/js/js.js"></script>

<style type="text/css">
.v * {
color: #698fca;
}
.v .vlist .vcard .vhead .vsys {
color: #3a3e4a;
}
.v .vlist .vcard .vh .vmeta .vat {
color: #638fd5;
}
.v .vlist .vcard .vhead .vnick {
color: #6ba1ff;
}
.v a {
color: #8696b1;
}
.v .vlist .vcard .vhead .vnick:hover {
color: #669bfc;
}
</style>
    <script type="text/javascript" color="173,174,173" opacity='1' zIndex="-2" count="99" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script>
</body>
</html>
